/*消息管理 */
layui.define(['layer','form'], function(exports) {
    var $ = layui.jquery;
    var layer=layui.layer;
    var form = layui.form();

    $('#btn_save').click(function(){
        var ex = /^\d+$/;
        if($("#on_before").val()==""){layer.msg("请填写上班提前时间设置");return false;}
        if($("#on_after").val()==""){layer.msg("请填写上班延后时间设置");return false;}
        if($("#off_before").val()==""){layer.msg("请填写下班提前时间设置");return false;}
        if($("#off_after").val()==""){layer.msg("请填写下班延后时间设置");return false;}
        if(!ex.test($("#on_before").val())){layer.msg("请填写从0开始的整数");return false;}
        if(!ex.test($("#on_after").val())){layer.msg("请填写从0开始的整数");return false;}
        if(!ex.test($("#off_before").val())){layer.msg("请填写从0开始的整数");return false;}
        if(!ex.test($("#off_after").val())){layer.msg("请填写从0开始的整数");return false;}
        var on_before = $("#on_before").val();
        var on_after = $("#on_after").val();
        var off_before = $("#off_before").val();
        var off_after = $("#off_after").val();
        $.post('/srv/sdo.php',{tpl:"edit_attend_time",on_before:on_before,on_after:on_after,off_before:off_before,off_after:off_after},function(e){
            if(e=='ok'){
                layer.msg('修改完成'); 
            }             
        })
    });
    //刷新
    $("#btn_ref").click(function(){
        location.reload();
    });
    exports('attend_sys_time', {});
});